<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Offset and Slope Trim Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ctb__functions__trim.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Offset and Slope Trim Functions<div class="ingroups"><a class="el" href="group__group__ctb.html">CTB          (Continuous Time Block)</a> &raquo; <a class="el" href="group__group__ctb__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>These are advanced functions for trimming the offset and slope of the opamps. </p>
<p>Most users do not need to call these functions and can use the factory trimmed values. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga0cbe0e749f65fe1e11a810b23479c12d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__trim.html#ga0cbe0e749f65fe1e11a810b23479c12d">Cy_CTB_OpampSetOffset</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> opampNum, uint32_t trim)</td></tr>
<tr class="memdesc:ga0cbe0e749f65fe1e11a810b23479c12d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Override the CTB opamp offset factory trim.  <a href="#ga0cbe0e749f65fe1e11a810b23479c12d">More...</a><br /></td></tr>
<tr class="separator:ga0cbe0e749f65fe1e11a810b23479c12d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae63790af2bbcded2b073a1d5a59f169d"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__trim.html#gae63790af2bbcded2b073a1d5a59f169d">Cy_CTB_OpampGetOffset</a> (const <a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> opampNum)</td></tr>
<tr class="memdesc:gae63790af2bbcded2b073a1d5a59f169d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the current CTB opamp offset trim value.  <a href="#gae63790af2bbcded2b073a1d5a59f169d">More...</a><br /></td></tr>
<tr class="separator:gae63790af2bbcded2b073a1d5a59f169d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa1b401598b7f5295e7a5de1c5574def5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__trim.html#gaa1b401598b7f5295e7a5de1c5574def5">Cy_CTB_OpampSetSlope</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> opampNum, uint32_t trim)</td></tr>
<tr class="memdesc:gaa1b401598b7f5295e7a5de1c5574def5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Override the CTB opamp slope factory trim.  <a href="#gaa1b401598b7f5295e7a5de1c5574def5">More...</a><br /></td></tr>
<tr class="separator:gaa1b401598b7f5295e7a5de1c5574def5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4913a1454b0f4553c477ffebb20dd3a4"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__trim.html#ga4913a1454b0f4553c477ffebb20dd3a4">Cy_CTB_OpampGetSlope</a> (const <a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> opampNum)</td></tr>
<tr class="memdesc:ga4913a1454b0f4553c477ffebb20dd3a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the CTB opamp slope trim value.  <a href="#ga4913a1454b0f4553c477ffebb20dd3a4">More...</a><br /></td></tr>
<tr class="separator:ga4913a1454b0f4553c477ffebb20dd3a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga0cbe0e749f65fe1e11a810b23479c12d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0cbe0e749f65fe1e11a810b23479c12d">&#9670;&nbsp;</a></span>Cy_CTB_OpampSetOffset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTB_OpampSetOffset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>opampNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>trim</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Override the CTB opamp offset factory trim. </p>
<p>The trim is a six bit value and the MSB is a direction bit.</p>
<table class="doxtable">
<tr>
<th>Bit 5 </th><th>Bits 4:0 </th><th>Note  </th></tr>
<tr>
<td>0 </td><td>00000 </td><td>Negative trim direction - minimum setting  </td></tr>
<tr>
<td>0 </td><td>11111 </td><td>Negative trim direction - maximum setting  </td></tr>
<tr>
<td>1 </td><td>00000 </td><td>Positive trim direction - minimum setting  </td></tr>
<tr>
<td>1 </td><td>11111 </td><td>Positive trim direction - maximum setting  </td></tr>
</table>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">opampNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>, <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a>, or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a4c859afffdcf6dcf16c4350906759488">CY_CTB_OPAMP_BOTH</a></td></tr>
    <tr><td class="paramname">trim</td><td>Trim value from 0 to 63</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Calibrate the offset trim by iterating through all the possible trim values. */</span></div><div class="line">    uint8_t trim;</div><div class="line">    <span class="keywordflow">for</span> (trim = 0u; trim &lt;= 0x3F; trim++)</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__ctb__functions__trim.html#ga0cbe0e749f65fe1e11a810b23479c12d">Cy_CTB_OpampSetOffset</a>(CTBM0, CY_CTB_OPAMP_0, trim);</div><div class="line">        </div><div class="line">        <span class="comment">/* Do something after changing the offset trim. */</span></div><div class="line">    }</div></div><!-- fragment -->
</div>
</div>
<a id="gae63790af2bbcded2b073a1d5a59f169d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae63790af2bbcded2b073a1d5a59f169d">&#9670;&nbsp;</a></span>Cy_CTB_OpampGetOffset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_CTB_OpampGetOffset </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>opampNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the current CTB opamp offset trim value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">opampNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a> or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Offset trim value</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Save the factory offset trim before changing it. */</span></div><div class="line">    uint32_t factoryOffset;</div><div class="line">    factoryOffset = <a class="code" href="group__group__ctb__functions__trim.html#gae63790af2bbcded2b073a1d5a59f169d">Cy_CTB_OpampGetOffset</a>(CTBM0, CY_CTB_OPAMP_0);</div></div><!-- fragment -->
</div>
</div>
<a id="gaa1b401598b7f5295e7a5de1c5574def5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa1b401598b7f5295e7a5de1c5574def5">&#9670;&nbsp;</a></span>Cy_CTB_OpampSetSlope()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTB_OpampSetSlope </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>opampNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>trim</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Override the CTB opamp slope factory trim. </p>
<p>The offset of the opamp will vary across temperature. This trim compensates for the slope of the offset across temperature. This compensation uses a bias current from the Analog Reference block. To disable it, set the trim to 0.</p>
<p>The trim is a six bit value and the MSB is a direction bit.</p>
<table class="doxtable">
<tr>
<th>Bit 5 </th><th>Bits 4:0 </th><th>Note  </th></tr>
<tr>
<td>0 </td><td>00000 </td><td>Negative trim direction - minimum setting  </td></tr>
<tr>
<td>0 </td><td>11111 </td><td>Negative trim direction - maximum setting  </td></tr>
<tr>
<td>1 </td><td>00000 </td><td>Positive trim direction - minimum setting  </td></tr>
<tr>
<td>1 </td><td>11111 </td><td>Positive trim direction - maximum setting  </td></tr>
</table>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">opampNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>, <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a>, or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a4c859afffdcf6dcf16c4350906759488">CY_CTB_OPAMP_BOTH</a></td></tr>
    <tr><td class="paramname">trim</td><td>Trim value from 0 to 63</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Calibrate the slope trim by iterating through all the possible trim values. */</span></div><div class="line">    uint8_t trim;</div><div class="line">    <span class="keywordflow">for</span> (trim = 0u; trim &lt;= 0x3F; trim++)</div><div class="line">    {</div><div class="line">        <a class="code" href="group__group__ctb__functions__trim.html#gaa1b401598b7f5295e7a5de1c5574def5">Cy_CTB_OpampSetSlope</a>(CTBM0, CY_CTB_OPAMP_0, trim);</div><div class="line">        </div><div class="line">        <span class="comment">/* Do something after changing the slope trim. */</span></div><div class="line">    }</div></div><!-- fragment -->
</div>
</div>
<a id="ga4913a1454b0f4553c477ffebb20dd3a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4913a1454b0f4553c477ffebb20dd3a4">&#9670;&nbsp;</a></span>Cy_CTB_OpampGetSlope()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_CTB_OpampGetSlope </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>opampNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the CTB opamp slope trim value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">opampNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a> or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Slope trim value</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Save the factory slope trim before changing it. */</span></div><div class="line">    uint32_t factorySlope;</div><div class="line">    factorySlope = <a class="code" href="group__group__ctb__functions__trim.html#ga4913a1454b0f4553c477ffebb20dd3a4">Cy_CTB_OpampGetSlope</a>(CTBM0, CY_CTB_OPAMP_0);</div></div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
